//Pietras93OS
//Stdarg
//pietras93@gmail.com
//

typedef unsigned char *va_list;

#define STACKITEM int

#define VA_SIZE(TYPE)                           \
        ((sizeof(TYPE) + sizeof(STACKITEM) - 1) \
                & ~(sizeof(STACKITEM) - 1))

#define va_start(AP, LASTARG) \
        (AP=((va_list)&(LASTARG) + VA_SIZE(LASTARG)))

#define va_end(AP) /* nothing */

#define va_arg(AP, TYPE) \
        (AP += VA_SIZE(TYPE), *((TYPE *)(AP - VA_SIZE(TYPE))))
